package cc.rengu.redp.bizimpl.upmp.dao;

import cc.rengu.redp.bizimpl.upmp.domain.BizTmp;
import com.baomidou.dynamic.datasource.annotation.DS;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.springframework.stereotype.Repository;

import java.util.List;
import java.util.Map;

/**
 * 临时表Mapper
 *
 * @author zhangxu
 */
@Repository
@DS("upmp")
public interface BizTmpMapper extends BaseMapper<BizTmp> {


    @Select("select * from T_B_BIZ_TMP where INST_ID =${instId} and OPR_TABLE_ENAME = ?2 and MASTER_KEY= ?3")
    List<BizTmp> getBizTmpByInstIdAndMasterKeyAndEname(String instId, String oprTableEname, String masterKey);

    List<Map>  findUserCountCheck(@Param("orgCode") String orgCode, @Param("instId") String instId);

    List<Map>  findSuperUserCountCheck(@Param("instId") String instId);

    @Select("select * from T_B_BIZ_TMP where REAL_ID =${id}")
    List<BizTmp> findOne(String id);

}
